"""
对张量进行取余，floor,ceil等运算
"""

import torch


def test():
    a = torch.rand(2, 2)
    a = a * 10
    print("========= a ===========")
    print(a)

    print("torch.floor(a)")
    print(torch.floor(a))
    print("torch.ceil(a)")
    print(torch.ceil(a))
    print("torch.round(a)")
    print(torch.round(a))
    print("torch.trunc(a)")
    print(torch.trunc(a))
    print("torch.frac(a)")
    print(torch.frac(a))
    print("a%2")
    print(a % 2)


if __name__ == '__main__':
    test()
